<?php
use_helper('I18N');
$culture = $sf_user->getCulture();
?>

<div class="home_slider">
    <ul id="home_slider">
        <li style="background:#b3c8cf url('/images/banner1.jpg') center center no-repeat;">
            <div class="slider_inner">
                <div class="slider_text">
                    <h1></h1>
                    <h2></h2>
                </div>
            </div>
        </li>
        <li style="background:#b3c8cf url('/images/img_slider2.jpg') center center no-repeat;">
            <div class="slider_inner">
                <div class="slider_text">
                    <h1><?php echo __("Professional Accounts") ?></h1>
                    <h2><?php echo __("EURUSD typical spread 1.8") ?></h2>
                </div>
            </div>
        </li>
        <li style="background:#b3c8cf url('/images/banner2.jpg') center center no-repeat;">
            <div class="slider_inner">
                <div class="slider_text">
                    <h1></h1>
                    <h2></h2>
                </div>
            </div>
        </li>
    </ul>
</div> <!---- end slider ----->

<div class="home_content">
    <div class="home_note">
        <div class="note_item item1">
            <div class="note_item_inner">
                <h4><?php echo __("Have a question? Call us today!") ?></h4>
                <h3>1300 345 789</h3>
            </div>
        </div>
        <div class="note_item item2 current">
            <div class="note_item_inner">
                <h4><?php echo __("We are opened from Mon - Fri") ?></h4>
                <h3><?php echo __("MON - FRI 08:00 - 20:00") ?></h3>
            </div>
        </div>
        <div class="note_item item3">
            <div class="note_item_inner">
                <h4><?php echo __("Need support? Drop us an email") ?></h4>
                <h3><a href="mailto:info@vicfx.com" style="color: #fff;">info@vicfx.com</a></h3>
            </div>
        </div>
    </div> <!---- end note ----->

    <div class="home_section product_section">
        <div class="section_inner">
            <div class="product_box">
                <h2 class="title"><?php echo __("Warrants and Structured Products") ?></h2>
                <div class="product_list">
                    <a href="/product/forex">
                        <div class="product_item first">
                            <img src="/images/icon_forex.png" alt="" class="icon" />
                            <h3><?php echo __("Forex") ?></h3>
                            <p><?php echo __("People invest in shares with the objective of generating wealth via income paid as dividends both.") ?></p>
                        </div>
                    </a>
                    <a href="/product/metals">
                        <div class="product_item">
                            <img src="/images/icon_meatals.png" alt="" class="icon" />
                            <h3><?php echo __("Metals") ?></h3>
                            <p><?php echo __("We follow latest industry standards to provide code of highest quality and easy to maintenance.") ?></p>
                        </div>
                    </a>
                    <a href="/product/energy">
                        <div class="product_item first">
                            <img src="/images/icon_engry.png" alt="" class="icon" />
                            <h3><?php echo __("Energy") ?></h3>
                            <p><?php echo __("By investing in shares on ASX you are buying part ownership of an ASX-listed company.") ?></p>
                        </div>
                    </a>
                    <a href="/product/agriculture">
                        <div class="product_item">
                            <img src="/images/icon_indices.png" alt="" class="icon" />
                            <h3><?php echo __("Agriculture") ?></h3>
                            <p><?php echo __("Mixed is trully multipurpose. This is an example of a modern business layout. Hope you like it!") ?></p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <div class="home_section analysis_section">
    <div class="section_inner">
        <div class="calender_box">
            <div class="market_box">
                <h2><?php echo __("market trend") ?></h2>
                <ul class="tab_title">
                    <li><a href="#tab1"><?php echo __("All") ?></a><span></span></li>
                    <li><a href="#tab2"><?php echo __("Forex") ?></a><span></span></li>
                    <li><a href="#tab3"><?php echo __("Metals") ?></a><span></span></li>
                </ul>
                <div class="tab_head">
                    <table>
                        <tr>
                            <td><?php echo __("PRODUCT") ?></td>
                            <td><?php echo __("BID") ?></td>
                            <td><?php echo __("ASK") ?></td>
                            <td><?php echo __("HIGH") ?></td>
                            <td><?php echo __("LOW") ?></td>
                        </tr>
                    </table>
                </div>
                <div class="tab_content">
                    <div id="tab1" class="tab_item">
                        <table>
                            <tr>
                                <td>GBPUSD</td>
                                <td class="red">1.29307</td>
                                <td class="red">1.29325</td>
                                <td>1.29337</td>
                                <td>1.29241<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDJPY</td>
                                <td class="green">110.060</td>
                                <td class="green">110.068</td>
                                <td>110.099</td>
                                <td>109.775<img src="/images/icon_down.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>NZDUSD</td>
                                <td class="red">0.81222</td>
                                <td class="red">0.81244</td>
                                <td>0.81458</td>
                                <td>0.81107<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>AUDUSD</td>
                                <td class="green">0.89277</td>
                                <td class="green">0.89287</td>
                                <td>0.89694</td>
                                <td>0.89208<img src="/images/icon_down.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>SILVER</td>
                                <td class="red">17.815</td>
                                <td class="red">17.849</td>
                                <td>18.339</td>
                                <td>17.791<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>GOLD</td>
                                <td class="red">1215.647</td>
                                <td class="red">1215.987</td>
                                <td>1221.380</td>
                                <td>1213.790<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDCAD</td>
                                <td class="red">1.09515</td>
                                <td class="red">1.09523</td>
                                <td>1.09775</td>
                                <td>1.09230<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>EURUSD</td>
                                <td class="red">1.29307</td>
                                <td class="red">1.29325</td>
                                <td>1.29337</td>
                                <td>1.29241<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDCHF</td>
                                <td class="red">0.94094</td>
                                <td class="red">0.94101</td>
                                <td>0.94097</td>
                                <td>0.93869<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                        </table>
                    </div>
                    <div id="tab2" class="tab_item">
                        <table>
                            <tr>
                                <td>GBPUSD</td>
                                <td class="red">1.29307</td>
                                <td class="red">1.29325</td>
                                <td>1.29337</td>
                                <td>1.29241<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDJPY</td>
                                <td class="green">110.060</td>
                                <td class="green">110.068</td>
                                <td>110.099</td>
                                <td>109.775<img src="/images/icon_down.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>NZDUSD</td>
                                <td class="red">0.81222</td>
                                <td class="red">0.81244</td>
                                <td>0.81458</td>
                                <td>0.81107<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>AUDUSD</td>
                                <td class="green">0.89277</td>
                                <td class="green">0.89287</td>
                                <td>0.89694</td>
                                <td>0.89208<img src="/images/icon_down.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDCAD</td>
                                <td class="red">1.09515</td>
                                <td class="red">1.09523</td>
                                <td>1.09775</td>
                                <td>1.09230<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>EURUSD</td>
                                <td class="red">1.29307</td>
                                <td class="red">1.29325</td>
                                <td>1.29337</td>
                                <td>1.29241<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>USDCHF</td>
                                <td class="red">0.94094</td>
                                <td class="red">0.94101</td>
                                <td>0.94097</td>
                                <td>0.93869<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                        </table>
                    </div>
                    <div id="tab3" class="tab_item">
                        <table>
                            <tr>
                                <td>SILVER</td>
                                <td class="red">17.815</td>
                                <td class="red">17.849</td>
                                <td>18.339</td>
                                <td>17.791<img src="/images/icon_up.png" alt=""/></td>
                            </tr>
                            <tr>
                                <td>GOLD</td>
                                <td class="red">1215.647</td>
                                <td class="red">1215.987</td>
                                <td>1221.380</td>
                                <td>1213.790<img src="/images/icon_up.png" alt=""/></td>
                            </tr>

                        </table>
                    </div>
                </div>
            </div>
            <div class="long_short">
                <h2 class="title"><?php echo __("Long & short") ?></h2>

                <div class="product_sub_title">
                    <h3><?php echo __("Product") ?></h3>

                    <div class="right_box">
                        <?php echo __("Long") ?>&nbsp;&nbsp;<img src="/images/icon_long.png" alt=""/>&nbsp;&nbsp;<?php echo __("Short") ?>&nbsp;&nbsp;<img src="/images/icon_short.png" alt=""/>
                    </div>
                </div>
                <div class="long_short_list">
                    <ul>
                        <li>
                            <h3>EURUSD</h3>

                            <div class="max_box">
                                <div class="long_box" style="width:70%;"><span>70%</span></div>
                                <div class="short_box" style="width:30%;"><span>30%</span></div>
                            </div>
                        </li>
                        <li>
                            <h3>AUDUSD</h3>

                            <div class="max_box">
                                <div class="long_box" style="width:80%;"><span>80%</span></div>
                                <div class="short_box" style="width:20%;"><span>20%</span></div>
                            </div>
                        </li>
                        <li>
                            <h3>USDJPY</h3>

                            <div class="max_box">
                                <div class="long_box" style="width:65%;"><span>65%</span></div>
                                <div class="short_box" style="width:35%;"><span>35%</span></div>
                            </div>
                        </li>
                        <li>
                            <h3>GBPUSD</h3>

                            <div class="max_box">
                                <div class="long_box" style="width:70%;"><span>70%</span></div>
                                <div class="short_box" style="width:30%;"><span>30%</span></div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div> <!---- end home_content ----->
</div> <!---- end content ----->

<script type="text/javascript" src="/js/home.js"></script>
<script type="text/javascript">
	function setQuote() {
		var tab1IsVisibale = $("#tab1").is(":visible");
		if (tab1IsVisibale) {
			var url = "/DDE_Webservice/Quote?name=vicfx&group=ALL";
			$.ajax({
                url : url,
                type : "get",
                async: false,
                dataType : "json",
                success : function(data){
                	json = data;
                	var jsonobj=eval(json);
					var $html = $("<table></table>");
					for(var i=0;i<jsonobj.length;i++){
						var name = jsonobj[i].PRODUCT;
						var bid = jsonobj[i].BID;
						var ask = jsonobj[i].ASK;
						var high = jsonobj[i].HIGH;
						var low = jsonobj[i].LOW;
						var _class = "class='red'";
						var upOrDown = "<img src='/images/icon_up.png' alt='' />";
						$("#tab1 table tr").each(function(){
							var oldName = $(this).find("td:first").html();
							if (oldName == name) {
								var oldBid = $(this).children('td').eq(1).html();
								//alert("oldBid:"+oldBid+",bid:"+bid);
								if (bid < oldBid) {
									_class = "class='green'";
									upOrDown = "<img src='/images/icon_down.png' alt='' />";
								}
							}

						});
						$html.append("<tr><td>"+name+"</td><td "+_class+">"+bid+"</td><td "+_class+">"+ask+"</td><td>"+high+"</td><td>"+low+upOrDown+"</td></tr>");
					}
					$('#tab1').empty();
					$("#tab1").append($html);
                },
                error : function(){
                	return;
                }
            });
		}

		var tab2IsVisibale = $("#tab2").is(":visible");
		if (tab2IsVisibale) {
			var url = "/DDE_Webservice/Quote?name=vicfx&group=FX";
			$.ajax({
                url : url,
                type : "get",
                async: false,
                dataType : "json",
                success : function(data){
                	json = data;
                	var jsonobj=eval(json);
					var $html = $("<table></table>");
					for(var i=0;i<jsonobj.length;i++){
						var name = jsonobj[i].PRODUCT;
						var bid = jsonobj[i].BID;
						var ask = jsonobj[i].ASK;
						var high = jsonobj[i].HIGH;
						var low = jsonobj[i].LOW;
						var _class = "class='red'";
						var upOrDown = "<img src='/images/icon_up.png' alt='' />";
						$("#tab2 table tr").each(function(){
							var oldName = $(this).find("td:first").html();
							if (oldName == name) {
								var oldBid = $(this).children('td').eq(1).html();
								//alert("oldBid:"+oldBid+",bid:"+bid);
								if (bid < oldBid) {
									_class = "class='green'";
									upOrDown = "<img src='/images/icon_down.png' alt='' />";
								}
							}

						});
						$html.append("<tr><td>"+name+"</td><td "+_class+">"+bid+"</td><td "+_class+">"+ask+"</td><td>"+high+"</td><td>"+low+upOrDown+"</td></tr>");
					}
					$('#tab2').empty();
					$("#tab2").append($html);
                },
                error : function(){
                	return;
                }
            });
		}

		var tab3IsVisibale = $("#tab3").is(":visible");
		if (tab3IsVisibale) {
			var url = "/DDE_Webservice/Quote?name=vicfx&group=METAL";
			var json;
			$.ajax({
                url : url,
                type : "get",
                async: false,
                dataType : "json",
                success : function(data){
                	json = data;
                	var jsonobj=eval(json);
					var $html = $("<table></table>");
					for(var i=0;i<jsonobj.length;i++){
						var name = jsonobj[i].PRODUCT;
						var bid = jsonobj[i].BID;
						var ask = jsonobj[i].ASK;
						var high = jsonobj[i].HIGH;
						var low = jsonobj[i].LOW;
						var _class = "class='red'";
						var upOrDown = "<img src='/images/icon_up.png' alt='' />";
						$("#tab3 table tr").each(function(){
							var oldName = $(this).find("td:first").html();
							if (oldName == name) {
								var oldBid = $(this).children('td').eq(1).html();
								//alert("oldBid:"+oldBid+",bid:"+bid);
								if (bid < oldBid) {
									_class = "class='green'";
									upOrDown = "<img src='/images/icon_down.png' alt='' />";
								}
							}

						});
						$html.append("<tr><td>"+name+"</td><td "+_class+">"+bid+"</td><td "+_class+">"+ask+"</td><td>"+high+"</td><td>"+low+upOrDown+"</td></tr>");
					}
					$('#tab3').empty();
					$("#tab3").append($html);
                },
                error : function(){
                	return;
                }
            });
		}
		setTimeout("setQuote()", 5000);
	}
	setQuote();
</script>